import axios from '@/utils/axios.js';
import {
	getUserId,
} from "@/router/auth.js"
import {
	getApiFabric
} from '@/api/customApi';

// 综管待办
export const zgMsg = () => getApiFabric({
	apiCode: "65814eff-007b-4f54-a69e-c9aa718ebc63",
	pageIndex: 1,
	pageSize: 20,
	params: [{
			code: 'DEPT_ID',
			value: ''
		}, {
			code: 'ALERT_TOP_TYPE',
			value: ''
		},
		{
			code: 'ALERT_TYPE',
			value: ''
		},
		{
			code: 'ALERT_TOP_REGION',
			value: ''
		},
		{
			code: 'ALERT_LEVEL',
			value: ''
		},
		{
			code: 'ALERT_STATUS',
			value: '未处理'
		}
	],
	propertyMapping: {
		ids: 'ids',
		id: "id",
		二级区域: "alertRegion",
		二级告警类型: "alertType",
		告警信息: "alertMessage",
		告警区域: "alertTopRegion",
		告警开始时间: "alertStartTime",
		告警状态: "alertStatus",
		告警等级: "alertLevel",
		告警类型: "alertTopType",
		归属部门: "deptName",
		处理措施: 'measure',
		处理人: 'procesName',
		处理时间: 'procesTime',
		处理中人: 'processingName',
		处理中时间: 'processingTime',
		处理中措施: 'processingReason'
	},
	total: true
}).then((res) => res.total)

// HSE待办接口
export const hseMsg = () => axios({
	method: 'post',
	data: {
		loginUserId: uni.getStorageSync('userName')
	},
	url: 'https://www.xjnyjtsthgs.com:38087/xjsthhse/hsedata/todoWorkNumber'
})

// 设备待办接口
export const sbsmzqMsg = () => axios({
	method: 'get',
	header: {
		isToken: false,
		"Gneecuserid": getUserId()
	},
	url: 'https://www.xjnyjtsthgs.com:39400/prod-api/message/info/unReadCount'
})

// 人员定位待办接口
export const rydwMsg = () => axios({
	method: 'get',
	url: `https://www.xjnyjtsthgs.com:51104/app-api/xjstm/warning/undoWarnCount/${getUserId()}`
})